Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Factorise add to my drive action. #1350

Open
wants to merge 18 commits into
base: externalLinks-famousLastFivePercent
Choose a base branch
from

Conversation

adrien-coye
Copy link
Contributor

@adrien-coye adrien-coye commented Dec 12, 2024

  • Add the "add to my drive" action in the contextual sheet.
  • Add to my drive works in multi-select.

This small branch lives on top of the "add to my drive" branch.

@adrien-coye adrien-coye changed the base branch from master to externalLinks-famousLastFivePercent December 12, 2024 16:53
@adrien-coye adrien-coye mentioned this pull request Dec 12, 2024
6 tasks
@adrien-coye adrien-coye force-pushed the externalLinks-addToMyDriveCellAction branch from 9422c9f to abd2bae Compare December 12, 2024 17:02
@adrien-coye adrien-coye marked this pull request as ready for review December 18, 2024 12:30
@adrien-coye adrien-coye force-pushed the externalLinks-famousLastFivePercent branch from 691feee to b2f40c3 Compare December 18, 2024 13:56
@adrien-coye adrien-coye marked this pull request as draft January 7, 2025 17:33
@adrien-coye adrien-coye marked this pull request as ready for review January 8, 2025 08:08
@adrien-coye adrien-coye marked this pull request as draft January 8, 2025 09:27
@adrien-coye adrien-coye changed the title feat: Add to my drive cell action. feat: Factorise add to my drive action. Jan 8, 2025
Copy link
Contributor Author

@adrien-coye adrien-coye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some notes for the reviewer

@@ -520,4 +522,30 @@ extension FileActionsFloatingPanelViewController {
}
}
}

private func addToMyDrive() {
guard accountManager.currentAccount != nil else {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm open to expose a new Bool in AccountManager to abstract if any user is authenticated or not.
Checking directly the array here is breaking encapsulation IMO.

import kDriveCore
import UIKit

struct PublicShareAction {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed to factorise something used between VCs and viewModels, thus created this adhoc type, open to put it somewhere else.

saveViewController.onDismissViewController = { [weak self] in
guard let self else { return }
self.onDismissViewController?()
if publicShareProxy.fileId != rootProxy.id, selectedItemsIds.isEmpty {
Copy link
Contributor Author

@adrien-coye adrien-coye Jan 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API doc does not cover this logic, yet I did not add a comment per our rules

@adrien-coye adrien-coye marked this pull request as ready for review January 8, 2025 14:52
Copy link

sonarqubecloud bot commented Jan 8, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant